package org.linlinjava.litemall.StrategyDesginModel;

import org.linlinjava.litemall.StrategyDesginModel.interfaces.MallSaleStrategy;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.math.RoundingMode;

/**
 * 黄金会员
 *
 * @author zhy
 * @create 2018-11-29 10:17
 **/
@Service
public class GolgStrategy implements MallSaleStrategy {

	@Override
	public BigDecimal sale(String name, BigDecimal money) {
		money = (money.multiply(new BigDecimal(0.8))).setScale(2, RoundingMode.HALF_UP);
		System.out.println("欢迎尊贵的黄金会员"+name+",消费"+money);
		return money;
	}

	@Override
	public String getType() {
		return "GoldMember";
	}
}
